#include"AVLTree.h"

void test1(){
    int arr[]={16, 3, 7, 11, 9, 26, 18, 14, 15};
    AVLTree<int,int> t;

    for(auto e : arr){
        t.insert(make_pair(e,e));
        cout<<"Insert:"<<e<<"->"<<t.IsBlance()<<endl;
    }

}

void test2(){
    int arr[]={4, 2, 6, 1, 3, 5, 15, 7, 16, 14};
    AVLTree<int,int> t;

    for(auto e : arr){
        t.insert(make_pair(e,e));
        cout<<"Insert:"<<e<<"->"<<t.IsBlance()<<endl;
    }
}

void test3(){
    const int N=10000000;
    vector<int> v;
    v.reserve(N);
    srand(time(0));

    for(size_t i=0;i<N;i++){
        v.push_back(i);
    }

    AVLTree<int,int> t;

    for(auto e : v){
        t.insert(make_pair(e,e));
    }
    cout<<t.IsBlance()<<endl;
    cout<<t.Height()<<endl;
}

int main(){
    //test1();
    //test2();
    test3();

    return 0;
}